home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / gcc / gcc261a.zoo / info / gcc.info-22 < prev    next >
Encoding:
GNU Info File  |  1994-10-31  |  42.1 KB  |  969 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.54 from the input
  2. file gcc.texi.
  3.  
  4.    This file documents the use and the internals of the GNU compiler.
  5.  
  6.    Published by the Free Software Foundation 675 Massachusetts Avenue
  7. Cambridge, MA 02139 USA
  8.  
  9.    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  10.  
  11.    Permission is granted to make and distribute verbatim copies of this
  12. manual provided the copyright notice and this permission notice are
  13. preserved on all copies.
  14.  
  15.    Permission is granted to copy and distribute modified versions of
  16. this manual under the conditions for verbatim copying, provided also
  17. that the sections entitled "GNU General Public License" and "Protect
  18. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  19. original, and provided that the entire resulting derived work is
  20. distributed under the terms of a permission notice identical to this
  21. one.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that the sections entitled "GNU General Public
  26. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  27. permission notice, may be included in translations approved by the Free
  28. Software Foundation instead of in the original English.
  29.  
  30. File: gcc.info,  Node: Initialization,  Next: Macros for Initialization,  Prev: Label Output,  Up: Assembler Format
  31.  
  32. How Initialization Functions Are Handled
  33. ----------------------------------------
  34.  
  35.    The compiled code for certain languages includes "constructors"
  36. (also called "initialization routines")--functions to initialize data
  37. in the program when the program is started.  These functions need to be
  38. called before the program is "started"--that is to say, before `main'
  39. is called.
  40.  
  41.    Compiling some languages generates "destructors" (also called
  42. "termination routines") that should be called when the program
  43. terminates.
  44.  
  45.    To make the initialization and termination functions work, the
  46. compiler must output something in the assembler code to cause those
  47. functions to be called at the appropriate time.  When you port the
  48. compiler to a new system, you need to specify how to do this.
  49.  
  50.    There are two major ways that GCC currently supports the execution of
  51. initialization and termination functions.  Each way has two variants.
  52. Much of the structure is common to all four variations.
  53.  
  54.    The linker must build two lists of these functions--a list of
  55. initialization functions, called `__CTOR_LIST__', and a list of
  56. termination functions, called `__DTOR_LIST__'.
  57.  
  58.    Each list always begins with an ignored function pointer (which may
  59. hold 0, -1, or a count of the function pointers after it, depending on
  60. the environment).  This is followed by a series of zero or more function
  61. pointers to constructors (or destructors), followed by a function
  62. pointer containing zero.
  63.  
  64.    Depending on the operating system and its executable file format,
  65. either `crtstuff.c' or `libgcc2.c' traverses these lists at startup
  66. time and exit time.  Constructors are called in forward order of the
  67. list; destructors in reverse order.
  68.  
  69.    The best way to handle static constructors works only for object file
  70. formats which provide arbitrarily-named sections.  A section is set
  71. aside for a list of constructors, and another for a list of destructors.
  72. Traditionally these are called `.ctors' and `.dtors'.  Each object file
  73. that defines an initialization function also puts a word in the
  74. constructor section to point to that function.  The linker accumulates
  75. all these words into one contiguous `.ctors' section.  Termination
  76. functions are handled similarly.
  77.  
  78.    To use this method, you need appropriate definitions of the macros
  79. `ASM_OUTPUT_CONSTRUCTOR' and `ASM_OUTPUT_DESTRUCTOR'.  Usually you can
  80. get them by including `svr4.h'.
  81.  
  82.    When arbitrary sections are available, there are two variants,
  83. depending upon how the code in `crtstuff.c' is called.  On systems that
  84. support an "init" section which is executed at program startup, parts
  85. of `crtstuff.c' are compiled into that section.  The program is linked
  86. by the `gcc' driver like this:
  87.  
  88.      ld -o OUTPUT_FILE crtbegin.o ... crtend.o -lgcc
  89.  
  90.    The head of a function (`__do_global_ctors') appears in the init
  91. section of `crtbegin.o'; the remainder of the function appears in the
  92. init section of `crtend.o'.  The linker will pull these two parts of
  93. the section together, making a whole function.  If any of the user's
  94. object files linked into the middle of it contribute code, then that
  95. code will be executed as part of the body of `__do_global_ctors'.
  96.  
  97.    To use this variant, you must define the `INIT_SECTION_ASM_OP' macro
  98. properly.
  99.  
  100.    If no init section is available, do not define
  101. `INIT_SECTION_ASM_OP'.  Then `__do_global_ctors' is built into the text
  102. section like all other functions, and resides in `libgcc.a'.  When GCC
  103. compiles any function called `main', it inserts a procedure call to
  104. `__main' as the first executable code after the function prologue.  The
  105. `__main' function, also defined in `libgcc2.c', simply calls
  106. `__do_global_ctors'.
  107.  
  108.    In file formats that don't support arbitrary sections, there are
  109. again two variants.  In the simplest variant, the GNU linker (GNU `ld')
  110. and an `a.out' format must be used.  In this case,
  111. `ASM_OUTPUT_CONSTRUCTOR' is defined to produce a `.stabs' entry of type
  112. `N_SETT', referencing the name `__CTOR_LIST__', and with the address of
  113. the void function containing the initialization code as its value.  The
  114. GNU linker recognizes this as a request to add the value to a "set";
  115. the values are accumulated, and are eventually placed in the executable
  116. as a vector in the format described above, with a leading (ignored)
  117. count and a trailing zero element.  `ASM_OUTPUT_DESTRUCTOR' is handled
  118. similarly.  Since no init section is available, the absence of
  119. `INIT_SECTION_ASM_OP' causes the compilation of `main' to call `__main'
  120. as above, starting the initialization process.
  121.  
  122.    The last variant uses neither arbitrary sections nor the GNU linker.
  123. This is preferable when you want to do dynamic linking and when using
  124. file formats which the GNU linker does not support, such as `ECOFF'.  In
  125. this case, `ASM_OUTPUT_CONSTRUCTOR' does not produce an `N_SETT'
  126. symbol; initialization and termination functions are recognized simply
  127. by their names.  This requires an extra program in the linkage step,
  128. called `collect2'.  This program pretends to be the linker, for use
  129. with GNU CC; it does its job by running the ordinary linker, but also
  130. arranges to include the vectors of initialization and termination
  131. functions.  These functions are called via `__main' as described above.
  132.  
  133.    Choosing among these configuration options has been simplified by a
  134. set of operating-system-dependent files in the `config' subdirectory.
  135. These files define all of the relevant parameters.  Usually it is
  136. sufficient to include one into your specific machine-dependent
  137. configuration file.  These files are:
  138.  
  139. `aoutos.h'
  140.      For operating systems using the `a.out' format.
  141.  
  142. `next.h'
  143.      For operating systems using the `MachO' format.
  144.  
  145. `svr3.h'
  146.      For System V Release 3 and similar systems using `COFF' format.
  147.  
  148. `svr4.h'
  149.      For System V Release 4 and similar systems using `ELF' format.
  150.  
  151. `vms.h'
  152.      For the VMS operating system.
  153.  
  154.    The following section describes the specific macros that control and
  155. customize the handling of initialization and termination functions.
  156.  
  157. File: gcc.info,  Node: Macros for Initialization,  Next: Instruction Output,  Prev: Initialization,  Up: Assembler Format
  158.  
  159. Macros Controlling Initialization Routines
  160. ------------------------------------------
  161.  
  162.    Here are the macros that control how the compiler handles
  163. initialization and termination functions:
  164.  
  165. `INIT_SECTION_ASM_OP'
  166.      If defined, a C string constant for the assembler operation to
  167.      identify the following data as initialization code.  If not
  168.      defined, GNU CC will assume such a section does not exist.  When
  169.      you are using special sections for initialization and termination
  170.      functions, this macro also controls how `crtstuff.c' and
  171.      `libgcc2.c' arrange to run the initialization functions.
  172.  
  173. `ASM_OUTPUT_CONSTRUCTOR (STREAM, NAME)'
  174.      Define this macro as a C statement to output on the stream STREAM
  175.      the assembler code to arrange to call the function named NAME at
  176.      initialization time.
  177.  
  178.      Assume that NAME is the name of a C function generated
  179.      automatically by the compiler.  This function takes no arguments.
  180.      Use the function `assemble_name' to output the name NAME; this
  181.      performs any system-specific syntactic transformations such as
  182.      adding an underscore.
  183.  
  184.      If you don't define this macro, nothing special is output to
  185.      arrange to call the function.  This is correct when the function
  186.      will be called in some other manner--for example, by means of the
  187.      `collect2' program, which looks through the symbol table to find
  188.      these functions by their names.
  189.  
  190. `ASM_OUTPUT_DESTRUCTOR (STREAM, NAME)'
  191.      This is like `ASM_OUTPUT_CONSTRUCTOR' but used for termination
  192.      functions rather than initialization functions.
  193.  
  194.    If your system uses `collect2' as the means of processing
  195. constructors, then that program normally uses `nm' to scan an object
  196. file for constructor functions to be called.  On certain kinds of
  197. systems, you can define these macros to make `collect2' work faster
  198. (and, in some cases, make it work at all):
  199.  
  200. `OBJECT_FORMAT_COFF'
  201.      Define this macro if the system uses COFF (Common Object File
  202.      Format) object files, so that `collect2' can assume this format
  203.      and scan object files directly for dynamic constructor/destructor
  204.      functions.
  205.  
  206. `OBJECT_FORMAT_ROSE'
  207.      Define this macro if the system uses ROSE format object files, so
  208.      that `collect2' can assume this format and scan object files
  209.      directly for dynamic constructor/destructor functions.
  210.  
  211.    These macros are effective only in a native compiler; `collect2' as
  212. part of a cross compiler always uses `nm'.
  213.  
  214. `REAL_NM_FILE_NAME'
  215.      Define this macro as a C string constant containing the file name
  216.      to use to execute `nm'.  The default is to search the path
  217.      normally for `nm'.
  218.  
  219. File: gcc.info,  Node: Instruction Output,  Next: Dispatch Tables,  Prev: Macros for Initialization,  Up: Assembler Format
  220.  
  221. Output of Assembler Instructions
  222. --------------------------------
  223.  
  224. `REGISTER_NAMES'
  225.      A C initializer containing the assembler's names for the machine
  226.      registers, each one as a C string constant.  This is what
  227.      translates register numbers in the compiler into assembler
  228.      language.
  229.  
  230. `ADDITIONAL_REGISTER_NAMES'
  231.      If defined, a C initializer for an array of structures containing
  232.      a name and a register number.  This macro defines additional names
  233.      for hard registers, thus allowing the `asm' option in declarations
  234.      to refer to registers using alternate names.
  235.  
  236. `ASM_OUTPUT_OPCODE (STREAM, PTR)'
  237.      Define this macro if you are using an unusual assembler that
  238.      requires different names for the machine instructions.
  239.  
  240.      The definition is a C statement or statements which output an
  241.      assembler instruction opcode to the stdio stream STREAM.  The
  242.      macro-operand PTR is a variable of type `char *' which points to
  243.      the opcode name in its "internal" form--the form that is written
  244.      in the machine description.  The definition should output the
  245.      opcode name to STREAM, performing any translation you desire, and
  246.      increment the variable PTR to point at the end of the opcode so
  247.      that it will not be output twice.
  248.  
  249.      In fact, your macro definition may process less than the entire
  250.      opcode name, or more than the opcode name; but if you want to
  251.      process text that includes `%'-sequences to substitute operands,
  252.      you must take care of the substitution yourself.  Just be sure to
  253.      increment PTR over whatever text should not be output normally.
  254.  
  255.      If you need to look at the operand values, they can be found as the
  256.      elements of `recog_operand'.
  257.  
  258.      If the macro definition does nothing, the instruction is output in
  259.      the usual way.
  260.  
  261. `FINAL_PRESCAN_INSN (INSN, OPVEC, NOPERANDS)'
  262.      If defined, a C statement to be executed just prior to the output
  263.      of assembler code for INSN, to modify the extracted operands so
  264.      they will be output differently.
  265.  
  266.      Here the argument OPVEC is the vector containing the operands
  267.      extracted from INSN, and NOPERANDS is the number of elements of
  268.      the vector which contain meaningful data for this insn.  The
  269.      contents of this vector are what will be used to convert the insn
  270.      template into assembler code, so you can change the assembler
  271.      output by changing the contents of the vector.
  272.  
  273.      This macro is useful when various assembler syntaxes share a single
  274.      file of instruction patterns; by defining this macro differently,
  275.      you can cause a large class of instructions to be output
  276.      differently (such as with rearranged operands).  Naturally,
  277.      variations in assembler syntax affecting individual insn patterns
  278.      ought to be handled by writing conditional output routines in
  279.      those patterns.
  280.  
  281.      If this macro is not defined, it is equivalent to a null statement.
  282.  
  283. `PRINT_OPERAND (STREAM, X, CODE)'
  284.      A C compound statement to output to stdio stream STREAM the
  285.      assembler syntax for an instruction operand X.  X is an RTL
  286.      expression.
  287.  
  288.      CODE is a value that can be used to specify one of several ways of
  289.      printing the operand.  It is used when identical operands must be
  290.      printed differently depending on the context.  CODE comes from the
  291.      `%' specification that was used to request printing of the
  292.      operand.  If the specification was just `%DIGIT' then CODE is 0;
  293.      if the specification was `%LTR DIGIT' then CODE is the ASCII code
  294.      for LTR.
  295.  
  296.      If X is a register, this macro should print the register's name.
  297.      The names can be found in an array `reg_names' whose type is `char
  298.      *[]'.  `reg_names' is initialized from `REGISTER_NAMES'.
  299.  
  300.      When the machine description has a specification `%PUNCT' (a `%'
  301.      followed by a punctuation character), this macro is called with a
  302.      null pointer for X and the punctuation character for CODE.
  303.  
  304. `PRINT_OPERAND_PUNCT_VALID_P (CODE)'
  305.      A C expression which evaluates to true if CODE is a valid
  306.      punctuation character for use in the `PRINT_OPERAND' macro.  If
  307.      `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no
  308.      punctuation characters (except for the standard one, `%') are used
  309.      in this way.
  310.  
  311. `PRINT_OPERAND_ADDRESS (STREAM, X)'
  312.      A C compound statement to output to stdio stream STREAM the
  313.      assembler syntax for an instruction operand that is a memory
  314.      reference whose address is X.  X is an RTL expression.
  315.  
  316.      On some machines, the syntax for a symbolic address depends on the
  317.      section that the address refers to.  On these machines, define the
  318.      macro `ENCODE_SECTION_INFO' to store the information into the
  319.      `symbol_ref', and then check for it here.  *Note Assembler
  320.      Format::.
  321.  
  322. `DBR_OUTPUT_SEQEND(FILE)'
  323.      A C statement, to be executed after all slot-filler instructions
  324.      have been output.  If necessary, call `dbr_sequence_length' to
  325.      determine the number of slots filled in a sequence (zero if not
  326.      currently outputting a sequence), to decide how many no-ops to
  327.      output, or whatever.
  328.  
  329.      Don't define this macro if it has nothing to do, but it is helpful
  330.      in reading assembly output if the extent of the delay sequence is
  331.      made explicit (e.g. with white space).
  332.  
  333.      Note that output routines for instructions with delay slots must be
  334.      prepared to deal with not being output as part of a sequence (i.e.
  335.      when the scheduling pass is not run, or when no slot fillers could
  336.      be found.)  The variable `final_sequence' is null when not
  337.      processing a sequence, otherwise it contains the `sequence' rtx
  338.      being output.
  339.  
  340. `REGISTER_PREFIX'
  341. `LOCAL_LABEL_PREFIX'
  342. `USER_LABEL_PREFIX'
  343. `IMMEDIATE_PREFIX'
  344.      If defined, C string expressions to be used for the `%R', `%L',
  345.      `%U', and `%I' options of `asm_fprintf' (see `final.c').  These
  346.      are useful when a single `md' file must support multiple assembler
  347.      formats.  In that case, the various `tm.h' files can define these
  348.      macros differently.
  349.  
  350. `ASSEMBLER_DIALECT'
  351.      If your target supports multiple dialects of assembler language
  352.      (such as different opcodes), define this macro as a C expression
  353.      that gives the numeric index of the assembler langauge dialect to
  354.      use, with zero as the first variant.
  355.  
  356.      If this macro is defined, you may use
  357.      `{option0|option1|option2...}' constructs in the output templates
  358.      of patterns (*note Output Template::.) or in the first argument of
  359.      `asm_fprintf'.  This construct outputs `option0', `option1' or
  360.      `option2', etc., if the value of `ASSEMBLER_DIALECT' is zero, one
  361.      or two, etc.  Any special characters within these strings retain
  362.      their usual meaning.
  363.  
  364.      If you do not define this macro, the characters `{', `|' and `}'
  365.      do not have any special meaning when used in templates or operands
  366.      to `asm_fprintf'.
  367.  
  368.      Define the macros `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX',
  369.      `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' if you can express the
  370.      variations in assemble language syntax with that mechanism.  Define
  371.      `ASSEMBLER_DIALECT' and use the `{option0|option1}' syntax if the
  372.      syntax variant are larger and involve such things as different
  373.      opcodes or operand order.
  374.  
  375. `ASM_OUTPUT_REG_PUSH (STREAM, REGNO)'
  376.      A C expression to output to STREAM some assembler code which will
  377.      push hard register number REGNO onto the stack.  The code need not
  378.      be optimal, since this macro is used only when profiling.
  379.  
  380. `ASM_OUTPUT_REG_POP (STREAM, REGNO)'
  381.      A C expression to output to STREAM some assembler code which will
  382.      pop hard register number REGNO off of the stack.  The code need
  383.      not be optimal, since this macro is used only when profiling.
  384.  
  385. File: gcc.info,  Node: Dispatch Tables,  Next: Alignment Output,  Prev: Instruction Output,  Up: Assembler Format
  386.  
  387. Output of Dispatch Tables
  388. -------------------------
  389.  
  390. `ASM_OUTPUT_ADDR_DIFF_ELT (STREAM, VALUE, REL)'
  391.      This macro should be provided on machines where the addresses in a
  392.      dispatch table are relative to the table's own address.
  393.  
  394.      The definition should be a C statement to output to the stdio
  395.      stream STREAM an assembler pseudo-instruction to generate a
  396.      difference between two labels.  VALUE and REL are the numbers of
  397.      two internal labels.  The definitions of these labels are output
  398.      using `ASM_OUTPUT_INTERNAL_LABEL', and they must be printed in the
  399.      same way here.  For example,
  400.  
  401.           fprintf (STREAM, "\t.word L%d-L%d\n",
  402.                    VALUE, REL)
  403.  
  404. `ASM_OUTPUT_ADDR_VEC_ELT (STREAM, VALUE)'
  405.      This macro should be provided on machines where the addresses in a
  406.      dispatch table are absolute.
  407.  
  408.      The definition should be a C statement to output to the stdio
  409.      stream STREAM an assembler pseudo-instruction to generate a
  410.      reference to a label.  VALUE is the number of an internal label
  411.      whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'.  For
  412.      example,
  413.  
  414.           fprintf (STREAM, "\t.word L%d\n", VALUE)
  415.  
  416. `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)'
  417.      Define this if the label before a jump-table needs to be output
  418.      specially.  The first three arguments are the same as for
  419.      `ASM_OUTPUT_INTERNAL_LABEL'; the fourth argument is the jump-table
  420.      which follows (a `jump_insn' containing an `addr_vec' or
  421.      `addr_diff_vec').
  422.  
  423.      This feature is used on system V to output a `swbeg' statement for
  424.      the table.
  425.  
  426.      If this macro is not defined, these labels are output with
  427.      `ASM_OUTPUT_INTERNAL_LABEL'.
  428.  
  429. `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)'
  430.      Define this if something special must be output at the end of a
  431.      jump-table.  The definition should be a C statement to be executed
  432.      after the assembler code for the table is written.  It should write
  433.      the appropriate code to stdio stream STREAM.  The argument TABLE
  434.      is the jump-table insn, and NUM is the label-number of the
  435.      preceding label.
  436.  
  437.      If this macro is not defined, nothing special is output at the end
  438.      of the jump-table.
  439.  
  440. File: gcc.info,  Node: Alignment Output,  Prev: Dispatch Tables,  Up: Assembler Format
  441.  
  442. Assembler Commands for Alignment
  443. --------------------------------
  444.  
  445. `ASM_OUTPUT_ALIGN_CODE (FILE)'
  446.      A C expression to output text to align the location counter in the
  447.      way that is desirable at a point in the code that is reached only
  448.      by jumping.
  449.  
  450.      This macro need not be defined if you don't want any special
  451.      alignment to be done at such a time.  Most machine descriptions do
  452.      not currently define the macro.
  453.  
  454. `ASM_OUTPUT_LOOP_ALIGN (FILE)'
  455.      A C expression to output text to align the location counter in the
  456.      way that is desirable at the beginning of a loop.
  457.  
  458.      This macro need not be defined if you don't want any special
  459.      alignment to be done at such a time.  Most machine descriptions do
  460.      not currently define the macro.
  461.  
  462. `ASM_OUTPUT_SKIP (STREAM, NBYTES)'
  463.      A C statement to output to the stdio stream STREAM an assembler
  464.      instruction to advance the location counter by NBYTES bytes.
  465.      Those bytes should be zero when loaded.  NBYTES will be a C
  466.      expression of type `int'.
  467.  
  468. `ASM_NO_SKIP_IN_TEXT'
  469.      Define this macro if `ASM_OUTPUT_SKIP' should not be used in the
  470.      text section because it fails put zeros in the bytes that are
  471.      skipped.  This is true on many Unix systems, where the pseudo-op
  472.      to skip bytes produces no-op instructions rather than zeros when
  473.      used in the text section.
  474.  
  475. `ASM_OUTPUT_ALIGN (STREAM, POWER)'
  476.      A C statement to output to the stdio stream STREAM an assembler
  477.      command to advance the location counter to a multiple of 2 to the
  478.      POWER bytes.  POWER will be a C expression of type `int'.
  479.  
  480. File: gcc.info,  Node: Debugging Info,  Next: Cross-compilation,  Prev: Assembler Format,  Up: Target Macros
  481.  
  482. Controlling Debugging Information Format
  483. ========================================
  484.  
  485. * Menu:
  486.  
  487. * All Debuggers::      Macros that affect all debugging formats uniformly.
  488. * DBX Options::        Macros enabling specific options in DBX format.
  489. * DBX Hooks::          Hook macros for varying DBX format.
  490. * File Names and DBX:: Macros controlling output of file names in DBX format.
  491. * SDB and DWARF::      Macros for SDB (COFF) and DWARF formats.
  492.  
  493. File: gcc.info,  Node: All Debuggers,  Next: DBX Options,  Up: Debugging Info
  494.  
  495. Macros Affecting All Debugging Formats
  496. --------------------------------------
  497.  
  498. `DBX_REGISTER_NUMBER (REGNO)'
  499.      A C expression that returns the DBX register number for the
  500.      compiler register number REGNO.  In simple cases, the value of this
  501.      expression may be REGNO itself.  But sometimes there are some
  502.      registers that the compiler knows about and DBX does not, or vice
  503.      versa.  In such cases, some register may need to have one number in
  504.      the compiler and another for DBX.
  505.  
  506.      If two registers have consecutive numbers inside GNU CC, and they
  507.      can be used as a pair to hold a multiword value, then they *must*
  508.      have consecutive numbers after renumbering with
  509.      `DBX_REGISTER_NUMBER'.  Otherwise, debuggers will be unable to
  510.      access such a pair, because they expect register pairs to be
  511.      consecutive in their own numbering scheme.
  512.  
  513.      If you find yourself defining `DBX_REGISTER_NUMBER' in way that
  514.      does not preserve register pairs, then what you must do instead is
  515.      redefine the actual register numbering scheme.
  516.  
  517. `DEBUGGER_AUTO_OFFSET (X)'
  518.      A C expression that returns the integer offset value for an
  519.      automatic variable having address X (an RTL expression).  The
  520.      default computation assumes that X is based on the frame-pointer
  521.      and gives the offset from the frame-pointer.  This is required for
  522.      targets that produce debugging output for DBX or COFF-style
  523.      debugging output for SDB and allow the frame-pointer to be
  524.      eliminated when the `-g' options is used.
  525.  
  526. `DEBUGGER_ARG_OFFSET (OFFSET, X)'
  527.      A C expression that returns the integer offset value for an
  528.      argument having address X (an RTL expression).  The nominal offset
  529.      is OFFSET.
  530.  
  531. `PREFERRED_DEBUGGING_TYPE'
  532.      A C expression that returns the type of debugging output GNU CC
  533.      produces when the user specifies `-g' or `-ggdb'.  Define this if
  534.      you have arranged for GNU CC to support more than one format of
  535.      debugging output.  Currently, the allowable values are `DBX_DEBUG',
  536.      `SDB_DEBUG', `DWARF_DEBUG', and `XCOFF_DEBUG'.
  537.  
  538.      The value of this macro only affects the default debugging output;
  539.      the user can always get a specific type of output by using
  540.      `-gstabs', `-gcoff', `-gdwarf', or `-gxcoff'.
  541.  
  542. File: gcc.info,  Node: DBX Options,  Next: DBX Hooks,  Prev: All Debuggers,  Up: Debugging Info
  543.  
  544. Specific Options for DBX Output
  545. -------------------------------
  546.  
  547. `DBX_DEBUGGING_INFO'
  548.      Define this macro if GNU CC should produce debugging output for DBX
  549.      in response to the `-g' option.
  550.  
  551. `XCOFF_DEBUGGING_INFO'
  552.      Define this macro if GNU CC should produce XCOFF format debugging
  553.      output in response to the `-g' option.  This is a variant of DBX
  554.      format.
  555.  
  556. `DEFAULT_GDB_EXTENSIONS'
  557.      Define this macro to control whether GNU CC should by default
  558.      generate GDB's extended version of DBX debugging information
  559.      (assuming DBX-format debugging information is enabled at all).  If
  560.      you don't define the macro, the default is 1: always generate the
  561.      extended information if there is any occasion to.
  562.  
  563. `DEBUG_SYMS_TEXT'
  564.      Define this macro if all `.stabs' commands should be output while
  565.      in the text section.
  566.  
  567. `ASM_STABS_OP'
  568.      A C string constant naming the assembler pseudo op to use instead
  569.      of `.stabs' to define an ordinary debugging symbol.  If you don't
  570.      define this macro, `.stabs' is used.  This macro applies only to
  571.      DBX debugging information format.
  572.  
  573. `ASM_STABD_OP'
  574.      A C string constant naming the assembler pseudo op to use instead
  575.      of `.stabd' to define a debugging symbol whose value is the current
  576.      location.  If you don't define this macro, `.stabd' is used.  This
  577.      macro applies only to DBX debugging information format.
  578.  
  579. `ASM_STABN_OP'
  580.      A C string constant naming the assembler pseudo op to use instead
  581.      of `.stabn' to define a debugging symbol with no name.  If you
  582.      don't define this macro, `.stabn' is used.  This macro applies
  583.      only to DBX debugging information format.
  584.  
  585. `DBX_NO_XREFS'
  586.      Define this macro if DBX on your system does not support the
  587.      construct `xsTAGNAME'.  On some systems, this construct is used to
  588.      describe a forward reference to a structure named TAGNAME.  On
  589.      other systems, this construct is not supported at all.
  590.  
  591. `DBX_CONTIN_LENGTH'
  592.      A symbol name in DBX-format debugging information is normally
  593.      continued (split into two separate `.stabs' directives) when it
  594.      exceeds a certain length (by default, 80 characters).  On some
  595.      operating systems, DBX requires this splitting; on others,
  596.      splitting must not be done.  You can inhibit splitting by defining
  597.      this macro with the value zero.  You can override the default
  598.      splitting-length by defining this macro as an expression for the
  599.      length you desire.
  600.  
  601. `DBX_CONTIN_CHAR'
  602.      Normally continuation is indicated by adding a `\' character to
  603.      the end of a `.stabs' string when a continuation follows.  To use
  604.      a different character instead, define this macro as a character
  605.      constant for the character you want to use.  Do not define this
  606.      macro if backslash is correct for your system.
  607.  
  608. `DBX_STATIC_STAB_DATA_SECTION'
  609.      Define this macro if it is necessary to go to the data section
  610.      before outputting the `.stabs' pseudo-op for a non-global static
  611.      variable.
  612.  
  613. `DBX_TYPE_DECL_STABS_CODE'
  614.      The value to use in the "code" field of the `.stabs' directive for
  615.      a typedef.  The default is `N_LSYM'.
  616.  
  617. `DBX_STATIC_CONST_VAR_CODE'
  618.      The value to use in the "code" field of the `.stabs' directive for
  619.      a static variable located in the text section.  DBX format does not
  620.      provide any "right" way to do this.  The default is `N_FUN'.
  621.  
  622. `DBX_REGPARM_STABS_CODE'
  623.      The value to use in the "code" field of the `.stabs' directive for
  624.      a parameter passed in registers.  DBX format does not provide any
  625.      "right" way to do this.  The default is `N_RSYM'.
  626.  
  627. `DBX_REGPARM_STABS_LETTER'
  628.      The letter to use in DBX symbol data to identify a symbol as a
  629.      parameter passed in registers.  DBX format does not customarily
  630.      provide any way to do this.  The default is `'P''.
  631.  
  632. `DBX_MEMPARM_STABS_LETTER'
  633.      The letter to use in DBX symbol data to identify a symbol as a
  634.      stack parameter.  The default is `'p''.
  635.  
  636. `DBX_FUNCTION_FIRST'
  637.      Define this macro if the DBX information for a function and its
  638.      arguments should precede the assembler code for the function.
  639.      Normally, in DBX format, the debugging information entirely
  640.      follows the assembler code.
  641.  
  642. `DBX_LBRAC_FIRST'
  643.      Define this macro if the `N_LBRAC' symbol for a block should
  644.      precede the debugging information for variables and functions
  645.      defined in that block.  Normally, in DBX format, the `N_LBRAC'
  646.      symbol comes first.
  647.  
  648. File: gcc.info,  Node: DBX Hooks,  Next: File Names and DBX,  Prev: DBX Options,  Up: Debugging Info
  649.  
  650. Open-Ended Hooks for DBX Format
  651. -------------------------------
  652.  
  653. `DBX_OUTPUT_LBRAC (STREAM, NAME)'
  654.      Define this macro to say how to output to STREAM the debugging
  655.      information for the start of a scope level for variable names.  The
  656.      argument NAME is the name of an assembler symbol (for use with
  657.      `assemble_name') whose value is the address where the scope begins.
  658.  
  659. `DBX_OUTPUT_RBRAC (STREAM, NAME)'
  660.      Like `DBX_OUTPUT_LBRAC', but for the end of a scope level.
  661.  
  662. `DBX_OUTPUT_ENUM (STREAM, TYPE)'
  663.      Define this macro if the target machine requires special handling
  664.      to output an enumeration type.  The definition should be a C
  665.      statement (sans semicolon) to output the appropriate information
  666.      to STREAM for the type TYPE.
  667.  
  668. `DBX_OUTPUT_FUNCTION_END (STREAM, FUNCTION)'
  669.      Define this macro if the target machine requires special output at
  670.      the end of the debugging information for a function.  The
  671.      definition should be a C statement (sans semicolon) to output the
  672.      appropriate information to STREAM.  FUNCTION is the
  673.      `FUNCTION_DECL' node for the function.
  674.  
  675. `DBX_OUTPUT_STANDARD_TYPES (SYMS)'
  676.      Define this macro if you need to control the order of output of the
  677.      standard data types at the beginning of compilation.  The argument
  678.      SYMS is a `tree' which is a chain of all the predefined global
  679.      symbols, including names of data types.
  680.  
  681.      Normally, DBX output starts with definitions of the types for
  682.      integers and characters, followed by all the other predefined
  683.      types of the particular language in no particular order.
  684.  
  685.      On some machines, it is necessary to output different particular
  686.      types first.  To do this, define `DBX_OUTPUT_STANDARD_TYPES' to
  687.      output those symbols in the necessary order.  Any predefined types
  688.      that you don't explicitly output will be output afterward in no
  689.      particular order.
  690.  
  691.      Be careful not to define this macro so that it works only for C.
  692.      There are no global variables to access most of the built-in
  693.      types, because another language may have another set of types.
  694.      The way to output a particular type is to look through SYMS to see
  695.      if you can find it.  Here is an example:
  696.  
  697.           {
  698.             tree decl;
  699.             for (decl = syms; decl; decl = TREE_CHAIN (decl))
  700.               if (!strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)),
  701.                            "long int"))
  702.                 dbxout_symbol (decl);
  703.             ...
  704.           }
  705.  
  706.      This does nothing if the expected type does not exist.
  707.  
  708.      See the function `init_decl_processing' in `c-decl.c' to find the
  709.      names to use for all the built-in C types.
  710.  
  711.      Here is another way of finding a particular type:
  712.  
  713.           {
  714.             tree decl;
  715.             for (decl = syms; decl; decl = TREE_CHAIN (decl))
  716.               if (TREE_CODE (decl) == TYPE_DECL
  717.                   && (TREE_CODE (TREE_TYPE (decl))
  718.                       == INTEGER_CST)
  719.                   && TYPE_PRECISION (TREE_TYPE (decl)) == 16
  720.                   && TYPE_UNSIGNED (TREE_TYPE (decl)))
  721.           /* This must be `unsigned short'.  */
  722.                 dbxout_symbol (decl);
  723.             ...
  724.           }
  725.  
  726. File: gcc.info,  Node: File Names and DBX,  Next: SDB and DWARF,  Prev: DBX Hooks,  Up: Debugging Info
  727.  
  728. File Names in DBX Format
  729. ------------------------
  730.  
  731. `DBX_WORKING_DIRECTORY'
  732.      Define this if DBX wants to have the current directory recorded in
  733.      each object file.
  734.  
  735.      Note that the working directory is always recorded if GDB
  736.      extensions are enabled.
  737.  
  738. `DBX_OUTPUT_MAIN_SOURCE_FILENAME (STREAM, NAME)'
  739.      A C statement to output DBX debugging information to the stdio
  740.      stream STREAM which indicates that file NAME is the main source
  741.      file--the file specified as the input file for compilation.  This
  742.      macro is called only once, at the beginning of compilation.
  743.  
  744.      This macro need not be defined if the standard form of output for
  745.      DBX debugging information is appropriate.
  746.  
  747. `DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (STREAM, NAME)'
  748.      A C statement to output DBX debugging information to the stdio
  749.      stream STREAM which indicates that the current directory during
  750.      compilation is named NAME.
  751.  
  752.      This macro need not be defined if the standard form of output for
  753.      DBX debugging information is appropriate.
  754.  
  755. `DBX_OUTPUT_MAIN_SOURCE_FILE_END (STREAM, NAME)'
  756.      A C statement to output DBX debugging information at the end of
  757.      compilation of the main source file NAME.
  758.  
  759.      If you don't define this macro, nothing special is output at the
  760.      end of compilation, which is correct for most machines.
  761.  
  762. `DBX_OUTPUT_SOURCE_FILENAME (STREAM, NAME)'
  763.      A C statement to output DBX debugging information to the stdio
  764.      stream STREAM which indicates that file NAME is the current source
  765.      file.  This output is generated each time input shifts to a
  766.      different source file as a result of `#include', the end of an
  767.      included file, or a `#line' command.
  768.  
  769.      This macro need not be defined if the standard form of output for
  770.      DBX debugging information is appropriate.
  771.  
  772. File: gcc.info,  Node: SDB and DWARF,  Prev: File Names and DBX,  Up: Debugging Info
  773.  
  774. Macros for SDB and DWARF Output
  775. -------------------------------
  776.  
  777. `SDB_DEBUGGING_INFO'
  778.      Define this macro if GNU CC should produce COFF-style debugging
  779.      output for SDB in response to the `-g' option.
  780.  
  781. `DWARF_DEBUGGING_INFO'
  782.      Define this macro if GNU CC should produce dwarf format debugging
  783.      output in response to the `-g' option.
  784.  
  785. `PUT_SDB_...'
  786.      Define these macros to override the assembler syntax for the
  787.      special SDB assembler directives.  See `sdbout.c' for a list of
  788.      these macros and their arguments.  If the standard syntax is used,
  789.      you need not define them yourself.
  790.  
  791. `SDB_DELIM'
  792.      Some assemblers do not support a semicolon as a delimiter, even
  793.      between SDB assembler directives.  In that case, define this macro
  794.      to be the delimiter to use (usually `\n').  It is not necessary to
  795.      define a new set of `PUT_SDB_OP' macros if this is the only change
  796.      required.
  797.  
  798. `SDB_GENERATE_FAKE'
  799.      Define this macro to override the usual method of constructing a
  800.      dummy name for anonymous structure and union types.  See
  801.      `sdbout.c' for more information.
  802.  
  803. `SDB_ALLOW_UNKNOWN_REFERENCES'
  804.      Define this macro to allow references to unknown structure, union,
  805.      or enumeration tags to be emitted.  Standard COFF does not allow
  806.      handling of unknown references, MIPS ECOFF has support for it.
  807.  
  808. `SDB_ALLOW_FORWARD_REFERENCES'
  809.      Define this macro to allow references to structure, union, or
  810.      enumeration tags that have not yet been seen to be handled.  Some
  811.      assemblers choke if forward tags are used, while some require it.
  812.  
  813. File: gcc.info,  Node: Cross-compilation,  Next: Misc,  Prev: Debugging Info,  Up: Target Macros
  814.  
  815. Cross Compilation and Floating Point
  816. ====================================
  817.  
  818.    While all modern machines use 2's complement representation for
  819. integers, there are a variety of representations for floating point
  820. numbers.  This means that in a cross-compiler the representation of
  821. floating point numbers in the compiled program may be different from
  822. that used in the machine doing the compilation.
  823.  
  824.    Because different representation systems may offer different amounts
  825. of range and precision, the cross compiler cannot safely use the host
  826. machine's floating point arithmetic.  Therefore, floating point
  827. constants must be represented in the target machine's format.  This
  828. means that the cross compiler cannot use `atof' to parse a floating
  829. point constant; it must have its own special routine to use instead.
  830. Also, constant folding must emulate the target machine's arithmetic (or
  831. must not be done at all).
  832.  
  833.    The macros in the following table should be defined only if you are
  834. cross compiling between different floating point formats.
  835.  
  836.    Otherwise, don't define them.  Then default definitions will be set
  837. up which use `double' as the data type, `==' to test for equality, etc.
  838.  
  839.    You don't need to worry about how many times you use an operand of
  840. any of these macros.  The compiler never uses operands which have side
  841. effects.
  842.  
  843. `REAL_VALUE_TYPE'
  844.      A macro for the C data type to be used to hold a floating point
  845.      value in the target machine's format.  Typically this would be a
  846.      `struct' containing an array of `int'.
  847.  
  848. `REAL_VALUES_EQUAL (X, Y)'
  849.      A macro for a C expression which compares for equality the two
  850.      values, X and Y, both of type `REAL_VALUE_TYPE'.
  851.  
  852. `REAL_VALUES_LESS (X, Y)'
  853.      A macro for a C expression which tests whether X is less than Y,
  854.      both values being of type `REAL_VALUE_TYPE' and interpreted as
  855.      floating point numbers in the target machine's representation.
  856.  
  857. `REAL_VALUE_LDEXP (X, SCALE)'
  858.      A macro for a C expression which performs the standard library
  859.      function `ldexp', but using the target machine's floating point
  860.      representation.  Both X and the value of the expression have type
  861.      `REAL_VALUE_TYPE'.  The second argument, SCALE, is an integer.
  862.  
  863. `REAL_VALUE_FIX (X)'
  864.      A macro whose definition is a C expression to convert the
  865.      target-machine floating point value X to a signed integer.  X has
  866.      type `REAL_VALUE_TYPE'.
  867.  
  868. `REAL_VALUE_UNSIGNED_FIX (X)'
  869.      A macro whose definition is a C expression to convert the
  870.      target-machine floating point value X to an unsigned integer.  X
  871.      has type `REAL_VALUE_TYPE'.
  872.  
  873. `REAL_VALUE_RNDZINT (X)'
  874.      A macro whose definition is a C expression to round the
  875.      target-machine floating point value X towards zero to an integer
  876.      value (but still as a floating point number).  X has type
  877.      `REAL_VALUE_TYPE', and so does the value.
  878.  
  879. `REAL_VALUE_UNSIGNED_RNDZINT (X)'
  880.      A macro whose definition is a C expression to round the
  881.      target-machine floating point value X towards zero to an unsigned
  882.      integer value (but still represented as a floating point number).
  883.      x has type `REAL_VALUE_TYPE', and so does the value.
  884.  
  885. `REAL_VALUE_ATOF (STRING, MODE)'
  886.      A macro for a C expression which converts STRING, an expression of
  887.      type `char *', into a floating point number in the target machine's
  888.      representation for mode MODE.  The value has type
  889.      `REAL_VALUE_TYPE'.
  890.  
  891. `REAL_INFINITY'
  892.      Define this macro if infinity is a possible floating point value,
  893.      and therefore division by 0 is legitimate.
  894.  
  895. `REAL_VALUE_ISINF (X)'
  896.      A macro for a C expression which determines whether X, a floating
  897.      point value, is infinity.  The value has type `int'.  By default,
  898.      this is defined to call `isinf'.
  899.  
  900. `REAL_VALUE_ISNAN (X)'
  901.      A macro for a C expression which determines whether X, a floating
  902.      point value, is a "nan" (not-a-number).  The value has type `int'.
  903.      By default, this is defined to call `isnan'.
  904.  
  905.    Define the following additional macros if you want to make floating
  906. point constant folding work while cross compiling.  If you don't define
  907. them, cross compilation is still possible, but constant folding will
  908. not happen for floating point values.
  909.  
  910. `REAL_ARITHMETIC (OUTPUT, CODE, X, Y)'
  911.      A macro for a C statement which calculates an arithmetic operation
  912.      of the two floating point values X and Y, both of type
  913.      `REAL_VALUE_TYPE' in the target machine's representation, to
  914.      produce a result of the same type and representation which is
  915.      stored in OUTPUT (which will be a variable).
  916.  
  917.      The operation to be performed is specified by CODE, a tree code
  918.      which will always be one of the following: `PLUS_EXPR',
  919.      `MINUS_EXPR', `MULT_EXPR', `RDIV_EXPR', `MAX_EXPR', `MIN_EXPR'.
  920.  
  921.      The expansion of this macro is responsible for checking for
  922.      overflow.  If overflow happens, the macro expansion should execute
  923.      the statement `return 0;', which indicates the inability to
  924.      perform the arithmetic operation requested.
  925.  
  926. `REAL_VALUE_NEGATE (X)'
  927.      A macro for a C expression which returns the negative of the
  928.      floating point value X.  Both X and the value of the expression
  929.      have type `REAL_VALUE_TYPE' and are in the target machine's
  930.      floating point representation.
  931.  
  932.      There is no way for this macro to report overflow, since overflow
  933.      can't happen in the negation operation.
  934.  
  935. `REAL_VALUE_TRUNCATE (MODE, X)'
  936.      A macro for a C expression which converts the floating point value
  937.      X to mode MODE.
  938.  
  939.      Both X and the value of the expression are in the target machine's
  940.      floating point representation and have type `REAL_VALUE_TYPE'.
  941.      However, the value should have an appropriate bit pattern to be
  942.      output properly as a floating constant whose precision accords
  943.      with mode MODE.
  944.  
  945.      There is no way for this macro to report overflow.
  946.  
  947. `REAL_VALUE_TO_INT (LOW, HIGH, X)'
  948.      A macro for a C expression which converts a floating point value X
  949.      into a double-precision integer which is then stored into LOW and
  950.      HIGH, two variables of type INT.
  951.  
  952. `REAL_VALUE_FROM_INT (X, LOW, HIGH)'
  953.      A macro for a C expression which converts a double-precision
  954.      integer found in LOW and HIGH, two variables of type INT, into a
  955.      floating point value which is then stored into X.
  956.  
  957.